package com.njtoyo.taxi.admin.rest.wrapper.business.driver;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@ApiModel(value = "司机扣分")
public class ScoreDeductingCreateWrapper {

    @NotNull(message = "司机id不能为空")
    @ApiModelProperty(value = "司机id")
    private Long driverId;

    @NotNull(message = "分数不能为空")
    @Min(value = 1, message = "不能小于1")
    @Max(value = 99, message = "不能大于99")
    @ApiModelProperty(value = "分数")
    private Integer value;

    @ApiModelProperty("开始时间，格式：yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @NotNull(message = "开始时间")
    private DateTime startedAt;

    @ApiModelProperty("结束时间，格式：yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @NotNull(message = "结束时间")
    private DateTime endedAt;

    @NotBlank(message = "扣分说明不能为空")
    @ApiModelProperty(value = "扣分说明")
    @Length(min = 1, max = 200, message = "扣分说明最多200字")
    private String detail;
}
